﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 采购订单基础输入参数
/// </summary>
public class PurchaseOrderBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 采购单号
    /// </summary>
    public virtual string? Odd { get; set; }
    
    /// <summary>
    /// 交货日期
    /// </summary>
    public virtual object? DeliveryDate { get; set; }
    
    /// <summary>
    /// 总价
    /// </summary>
    public virtual string? TotalPrices { get; set; }
    
    /// <summary>
    /// 供应商
    /// </summary>
    public virtual long? VendorId { get; set; }
    
    /// <summary>
    /// 收货地址
    /// </summary>
    public virtual string? Address { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Desc { get; set; }
    
    /// <summary>
    /// 类型
    /// </summary>
    public virtual string? PurchaseType { get; set; }
    
    /// <summary>
    /// 是否含税
    /// </summary>
    public virtual bool? IsTax { get; set; }
    
}

/// <summary>
/// 采购订单分页查询输入参数
/// </summary>
public class PagePurchaseOrderInput : BasePageInput
{
    /// <summary>
    /// 采购单号
    /// </summary>
    public string? Odd { get; set; }
    
    /// <summary>
    /// 交货日期
    /// </summary>
    public object? DeliveryDate { get; set; }
    
    /// <summary>
    /// 总价
    /// </summary>
    public string? TotalPrices { get; set; }
    
    /// <summary>
    /// 供应商
    /// </summary>
    public long? VendorId { get; set; }
    
    /// <summary>
    /// 收货地址
    /// </summary>
    public string? Address { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public string? Desc { get; set; }
    
    /// <summary>
    /// 类型
    /// </summary>
    public string? PurchaseType { get; set; }
    
    /// <summary>
    /// 是否含税
    /// </summary>
    public bool? IsTax { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 采购订单增加输入参数
/// </summary>
public class AddPurchaseOrderInput
{
    /// <summary>
    /// 采购单号
    /// </summary>
    [MaxLength(32, ErrorMessage = "采购单号字符长度不能超过32")]
    public string? Odd { get; set; }
    
    /// <summary>
    /// 交货日期
    /// </summary>
    public object? DeliveryDate { get; set; }
    
    /// <summary>
    /// 总价
    /// </summary>
    [MaxLength(32, ErrorMessage = "总价字符长度不能超过32")]
    public string? TotalPrices { get; set; }
    
    /// <summary>
    /// 供应商
    /// </summary>
    public long? VendorId { get; set; }
    
    /// <summary>
    /// 收货地址
    /// </summary>
    [MaxLength(32, ErrorMessage = "收货地址字符长度不能超过32")]
    public string? Address { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(32, ErrorMessage = "备注字符长度不能超过32")]
    public string? Desc { get; set; }
    
    /// <summary>
    /// 类型
    /// </summary>
    [MaxLength(32, ErrorMessage = "类型字符长度不能超过32")]
    public string? PurchaseType { get; set; }
    
    /// <summary>
    /// 是否含税
    /// </summary>
    public bool? IsTax { get; set; }
    
}

/// <summary>
/// 采购订单删除输入参数
/// </summary>
public class DeletePurchaseOrderInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 采购订单更新输入参数
/// </summary>
public class UpdatePurchaseOrderInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 采购单号
    /// </summary>    
    [MaxLength(32, ErrorMessage = "采购单号字符长度不能超过32")]
    public string? Odd { get; set; }
    
    /// <summary>
    /// 交货日期
    /// </summary>    
    public object? DeliveryDate { get; set; }
    
    /// <summary>
    /// 总价
    /// </summary>    
    [MaxLength(32, ErrorMessage = "总价字符长度不能超过32")]
    public string? TotalPrices { get; set; }
    
    /// <summary>
    /// 供应商
    /// </summary>    
    public long? VendorId { get; set; }
    
    /// <summary>
    /// 收货地址
    /// </summary>    
    [MaxLength(32, ErrorMessage = "收货地址字符长度不能超过32")]
    public string? Address { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(32, ErrorMessage = "备注字符长度不能超过32")]
    public string? Desc { get; set; }
    
    /// <summary>
    /// 类型
    /// </summary>    
    [MaxLength(32, ErrorMessage = "类型字符长度不能超过32")]
    public string? PurchaseType { get; set; }
    
    /// <summary>
    /// 是否含税
    /// </summary>    
    public bool? IsTax { get; set; }
    
}

/// <summary>
/// 采购订单主键查询输入参数
/// </summary>
public class QueryByIdPurchaseOrderInput : DeletePurchaseOrderInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataPurchaseOrderInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 采购订单数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportPurchaseOrderInput : BaseImportInput
{
    /// <summary>
    /// 采购单号
    /// </summary>
    [ImporterHeader(Name = "采购单号")]
    [ExporterHeader("采购单号", Format = "", Width = 25, IsBold = true)]
    public string? Odd { get; set; }
    
    /// <summary>
    /// 交货日期
    /// </summary>
    [ImporterHeader(Name = "交货日期")]
    [ExporterHeader("交货日期", Format = "", Width = 25, IsBold = true)]
    public object? DeliveryDate { get; set; }
    
    /// <summary>
    /// 总价
    /// </summary>
    [ImporterHeader(Name = "总价")]
    [ExporterHeader("总价", Format = "", Width = 25, IsBold = true)]
    public string? TotalPrices { get; set; }
    
    /// <summary>
    /// 供应商 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? VendorId { get; set; }
    
    /// <summary>
    /// 供应商 文本
    /// </summary>
    [ImporterHeader(Name = "供应商")]
    [ExporterHeader("供应商", Format = "", Width = 25, IsBold = true)]
    public string VendorFkDisplayName { get; set; }
    
    /// <summary>
    /// 收货地址
    /// </summary>
    [ImporterHeader(Name = "收货地址")]
    [ExporterHeader("收货地址", Format = "", Width = 25, IsBold = true)]
    public string? Address { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Desc { get; set; }
    
    /// <summary>
    /// 类型
    /// </summary>
    [ImporterHeader(Name = "类型")]
    [ExporterHeader("类型", Format = "", Width = 25, IsBold = true)]
    public string? PurchaseType { get; set; }
    
    /// <summary>
    /// 是否含税
    /// </summary>
    [ImporterHeader(Name = "是否含税")]
    [ExporterHeader("是否含税", Format = "", Width = 25, IsBold = true)]
    public bool? IsTax { get; set; }
    
}
